from dbus import  Interface
	 
class Notifier(object):
 
    def __init__(self, bus, replace=False, app_name=''):
        self.proxy = bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications')
        self.interface = Interface(self.proxy,dbus_interface='org.freedesktop.Notifications')
        self.app_name = app_name
        self.prev = 0
        self.replace = replace
     
    def notify(self, message, timeout=-1):
        self.prev = self.interface.Notify('System',self.prev, '', self.app_name, message, [], {}, timeout)
        if self.replace:
            self.prev = 0
